﻿<%@ Page Language="C#" MasterPageFile="~/UserControl_Manager/MasterPage_Manager.Master"
    AutoEventWireup="true" CodeBehind="OrderManager.aspx.cs" Inherits="TMDT_Nhom1A.Manager.OrderManager"
    Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="module_round_box_inner">
                <div class="module_round_box_inner2">
                    <div class="s5_mod_h3_1">
                        <div class="s5_mod_h3_2">
                            <h3 class="s5_mod_h3">
                                <span class="s5_h3_first">Danh sách các Order Coupon</span>
                            </h3>
                        </div>
                    </div>
                    <asp:GridView ID="gvOrderManager" runat="server" Width="100%" AutoGenerateColumns="False"
                        OnRowCommand="gvOrderManager_RowCommand" OnRowDataBound="gvOrderManager_RowDataBound"
                        AllowPaging="True" PageSize="10" OnPageIndexChanging="gvOrderManager_PageIndexChanging">
                        <Columns>
                            <asp:BoundField HeaderText="Mã Order Coupon" DataField="OrderCouponID">
                                <ItemStyle Width="125px" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Tên Công ty" DataField="Name_Company">
                                <ItemStyle Width="125px" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Ngày Order" DataField="OrderedDate">
                                <ItemStyle Width="125px" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="Trạng Thái vận chuyển">
                                <ItemTemplate>
                                    <asp:Label ID="lbTransportStatus" Visible="false" runat="server" Text='<%# Eval("TransportStatus") %>'></asp:Label>
                                    <asp:Label ID="lbTransportStatusInfo" runat="server" Text="Label"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle Width="100px" HorizontalAlign="Center" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Trạng Thái thanh toán">
                                <ItemTemplate>
                                    <asp:Label ID="lbPaymentStatus" Visible="false" runat="server" Text='<%# Eval("PaymentSatus") %>'></asp:Label>
                                    <asp:Label ID="lbPaymentStatusInfo" runat="server" Text="Label"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle Width="100px" HorizontalAlign="Center" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Chi Tiết Hoá Đơn">
                                <ItemTemplate>
                                    <asp:ImageButton ID="btViewOrderDetail" Width="30px" Height="30px" CommandName="btViewOrderDetail"
                                        CommandArgument='<%# Eval("OrderCouponID") %>' ImageUrl="~/images/xem-chi-tiet.png"
                                        runat="server" />
                                </ItemTemplate>
                                <ItemStyle Width="100px" HorizontalAlign="Center" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tình trạng">
                                <ItemTemplate>
                                    <asp:Label ID="lbstatus" Visible="false" runat="server" Text='<%# Eval("Status") %>'></asp:Label>
                                    <asp:Label ID="lbinformation" runat="server" Text="Label"></asp:Label>
                                </ItemTemplate>
                                <ItemStyle Width="100px" HorizontalAlign="Center" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <asp:ImageButton ID="btCheckAll" runat="server" ImageUrl="~/images/Check-icon.png"
                                        CommandName="CheckAll" />
                                    <asp:CheckBox ID="cbCheckAll" Visible="false" Checked="false" runat="server" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbcheck" runat="server" />
                                </ItemTemplate>
                                <ItemStyle Width="50px" HorizontalAlign="Center" />
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle CssClass="HeaderGrid" />
                    </asp:GridView>
                    <br />
                    Kết Quả:
                    <asp:Label ID="LbResult" runat="server"></asp:Label>
                    <br />
                    <br />
                    <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                        <ProgressTemplate>
                            Đang lấy dữ liệu từ server...
                            <img src="../images/ajax-loader.gif" />&nbsp;&nbsp;
                        </ProgressTemplate>
                    </asp:UpdateProgress>
                    <div style="margin-left: 500px; display: inline;">
                        <br />
                        <asp:Button ID="btactive" runat="server" Text="Chấp nhận" OnClientClick="if(!confirm('Bạn có muốn chấp nhận hết tất cả không ?')) return false;"
                            OnClick="btactive_Click" />
                        <asp:Button ID="btdisactive" runat="server" Text="Không Chấp Nhận" OnClientClick="if(!confirm('Bạn có muốn không chấp nhận hết tất cả không ?')) return false;"
                            OnClick="btdisactive_Click" />
                    </div>
                </div>
            </div>
            <div class="module_round_box_inner" id="ViewDetailPanel" runat="server" visible="false">
                <div class="module_round_box_inner2">
                    <div class="s5_mod_h3_1">
                        <div class="s5_mod_h3_2">
                            <h3 class="s5_mod_h3">
                                <span class="s5_h3_first">Chi Tiết Hoá Đơn</span>
                            </h3>
                        </div>
                    </div>
                    <div style="margin-top: 10px; margin-bottom: 10px">
                        <div style="margin-left: 20px; margin-bottom: 10px">
                            <b>Ngày đặt mua :
                                <asp:Label ID="lbdate" runat="server" Text="Label"></asp:Label></b>
                        </div>
                        <asp:GridView ID="gvdetail" runat="server" Width="100%" AutoGenerateColumns="False">
                            <Columns>
                                <asp:TemplateField HeaderText="Hóa đơn">
                                    <ItemTemplate>
                                        <a href='<%# "../San_Pham/ChiTietSanPham.aspx?CouponID=" + Eval("Coupon_ID") %>'>
                                            <%# Eval("Coupon_ID")%></a>
                                    </ItemTemplate>
                                    <ItemStyle Width="200px" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="Quantity" HeaderText="Số lượng">
                                    <ItemStyle HorizontalAlign="Left" Width="200px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="Cost" HeaderText="Thành tiền" DataFormatString="{0:###,###,### VND}">
                                    <ItemStyle HorizontalAlign="Center" Width="200px" />
                                </asp:BoundField>
                            </Columns>
                            <HeaderStyle CssClass="HeaderGrid" />
                        </asp:GridView>
                        <div style="margin-left: 400px; margin-top: 10px">
                            <b>Tổng tiền :
                                <asp:Label ID="lbtotalprice" Font-Bold="true" ForeColor="Red" runat="server" Text="Label"></asp:Label></b>
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
